import { user } from "@/api/request";
//import { defaultLocation } from "_@vueuse_core@9.6.0@@vueuse/core";

/* 获取权限资源列表 */
export function get(parameter: object) {
  return user({
    url: `/resource`,
    method: "get",
    params: parameter,
  });
}
/* 新增权限资源 */
export function add(data: object) {
  return user({
    url: `/resource`,
    method: "post",
    data: data,
  });
}

/* 删除权限资源 */
export function del(id: number) {
  return user({
    url: `/resource/delete/${id}`,
    method: "get",
  });
}

/* 更新权限资源 */
export function update(data: object) {
  return user({
    url: `/resource/update`,
    method: "post",
    data: data,
  });
}

export default {
  add,
  del,
  get,
  update,
};
